package com.fy.fyzf.presenter;

import com.fy.fyzf.api.SubscriberCallBack;
import com.fy.fyzf.base.BasePresenter;
import com.fy.fyzf.bean.AddHousingBean1;
import com.fy.fyzf.bean.BaseData;
import com.fy.fyzf.bean.BuildingDetailBean;
import com.fy.fyzf.bean.HousesBean;
import com.fy.fyzf.bean.HousesListBean;
import com.fy.fyzf.bean.HousesListBean1;
import com.fy.fyzf.view.BuildDetailCallBack;

import java.util.List;

public class BuildDetailPresenter extends BasePresenter<BuildDetailCallBack> {
    public BuildDetailPresenter(BuildDetailCallBack view) {
        super(view);
    }

    public void getBuildingDetail(int id){
        addSubscription(mApiService.floorDetails(id), new SubscriberCallBack<BaseData<BuildingDetailBean>>(mView,true) {
            @Override
            protected void onSuccess(BaseData<BuildingDetailBean> response) {
                mView.getBuildingDetailSuccess(response.data);
            }

            @Override
            protected void onError() {

            }
        });
    }

    public void  getHouseList(AddHousingBean1 housesBean){
        addSubscription(mApiService.getHouseList(housesBean), new SubscriberCallBack<BaseData<List<HousesListBean1>>>(mView,true) {
            @Override
            protected void onSuccess(BaseData<List<HousesListBean1>> response) {
                mView.getHouseListSuccess(response.data);
            }

            @Override
            protected void onError() {

            }
        });
    }
}
